From 357c50b14ed672559582e44b9ea1547497ca2e3b Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Sat, 10 Oct 1998 01:55:09 +0000 Subject: [PATCH] take the left, right, top and bottom attach arguments as mandatory and Sat Oct 10 03:37:50 1998 Tim Janik * gtk/gtktable.c (gtk_table_set_child_arg): take the left, right, top and bottom attach arguments as mandatory and readjust the table size and opposing edge accordingly if required. this way the order in which the arguments are set doesn't matter. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-0 | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-2 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ TODO | 20 ++++++++++++-------- gtk/gtktable.c | 38 ++++++++++++++++++++++++++------------ 9 files changed, 87 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index faff0e9095..a6336ee93c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat Oct 10 03:37:50 1998 Tim Janik + + * gtk/gtktable.c (gtk_table_set_child_arg): take the left, right, top + and bottom attach arguments as mandatory and readjust the table size + and opposing edge accordingly if required. this way the order in which + the arguments are set doesn't matter. + Thu Oct 8 15:53:59 1998 Owen Taylor * gtk/gtktypeutils.c (gtk_type_class_init): Fixed warning diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index faff0e9095..a6336ee93c 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +Sat Oct 10 03:37:50 1998 Tim Janik + + * gtk/gtktable.c (gtk_table_set_child_arg): take the left, right, top + and bottom attach arguments as mandatory and readjust the table size + and opposing edge accordingly if required. this way the order in which + the arguments are set doesn't matter. + Thu Oct 8 15:53:59 1998 Owen Taylor * gtk/gtktypeutils.c (gtk_type_class_init): Fixed warning diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index faff0e9095..a6336ee93c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Sat Oct 10 03:37:50 1998 Tim Janik + + * gtk/gtktable.c (gtk_table_set_child_arg): take the left, right, top + and bottom attach arguments as mandatory and readjust the table size + and opposing edge accordingly if required. this way the order in which + the arguments are set doesn't matter. + Thu Oct 8 15:53:59 1998 Owen Taylor * gtk/gtktypeutils.c (gtk_type_class_init): Fixed warning diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index faff0e9095..a6336ee93c 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +Sat Oct 10 03:37:50 1998 Tim Janik + + * gtk/gtktable.c (gtk_table_set_child_arg): take the left, right, top + and bottom attach arguments as mandatory and readjust the table size + and opposing edge accordingly if required. this way the order in which + the arguments are set doesn't matter. + Thu Oct 8 15:53:59 1998 Owen Taylor * gtk/gtktypeutils.c (gtk_type_class_init): Fixed warning diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index faff0e9095..a6336ee93c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Sat Oct 10 03:37:50 1998 Tim Janik + + * gtk/gtktable.c (gtk_table_set_child_arg): take the left, right, top + and bottom attach arguments as mandatory and readjust the table size + and opposing edge accordingly if required. this way the order in which + the arguments are set doesn't matter. + Thu Oct 8 15:53:59 1998 Owen Taylor * gtk/gtktypeutils.c (gtk_type_class_init): Fixed warning diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index faff0e9095..a6336ee93c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Sat Oct 10 03:37:50 1998 Tim Janik + + * gtk/gtktable.c (gtk_table_set_child_arg): take the left, right, top + and bottom attach arguments as mandatory and readjust the table size + and opposing edge accordingly if required. this way the order in which + the arguments are set doesn't matter. + Thu Oct 8 15:53:59 1998 Owen Taylor * gtk/gtktypeutils.c (gtk_type_class_init): Fixed warning diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index faff0e9095..a6336ee93c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Sat Oct 10 03:37:50 1998 Tim Janik + + * gtk/gtktable.c (gtk_table_set_child_arg): take the left, right, top + and bottom attach arguments as mandatory and readjust the table size + and opposing edge accordingly if required. this way the order in which + the arguments are set doesn't matter. + Thu Oct 8 15:53:59 1998 Owen Taylor * gtk/gtktypeutils.c (gtk_type_class_init): Fixed warning diff --git a/TODO b/TODO index 53589a8423..563a52c89a 100644 --- a/TODO +++ b/TODO @@ -6,7 +6,19 @@ Bugs: * Widget redrawing when the window resizes sometimes messes up. GtkLabels sometimes redraw without clearing up the underlying background on window resizes. + + * Change bitfields to guints from enums, or vice versa? + + * MappingNotify events produce warnings. + + * gtk_widget_set_uposition can't handle negative x,y coordinates! + + * the type system (gtktypeutils.c) has to handle creations of fundamental + types seperatedly from derived types, so we don't screw foreign + fundamental types with an already extensively increased seqno. + * Expose events aren't being generated correctly for DND demo + * delay dnd settings to take effect once a widget is realized, this is to avoid force realizations. i think this goes along with owens dnd changes? @@ -35,14 +47,6 @@ Bugs: segfault in malloc -timj - * Change bitfields to guints from enums, or vice versa? - - * Expose events aren't being generated correctly for DND demo - - * MappingNotify events produce warnings. - - * gtk_widget_set_uposition can't handle negative x,y coordinates! - Additions: * implement keyboard navigation in menus diff --git a/gtk/gtktable.c b/gtk/gtktable.c index 08e048f266..ad09b98bc2 100644 --- a/gtk/gtktable.c +++ b/gtk/gtktable.c @@ -258,25 +258,39 @@ gtk_table_set_child_arg (GtkContainer *container, switch (arg_id) { case CHILD_ARG_LEFT_ATTACH: - if (GTK_VALUE_UINT (*arg) < table_child->right_attach) - table_child->left_attach = GTK_VALUE_UINT (*arg); - break; - case CHILD_ARG_RIGHT_ATTACH: - if (GTK_VALUE_UINT (*arg) > table_child->left_attach) - table_child->right_attach = GTK_VALUE_UINT (*arg); + table_child->left_attach = GTK_VALUE_UINT (*arg); + if (table_child->right_attach <= table_child->left_attach) + table_child->right_attach = table_child->left_attach + 1; if (table_child->right_attach >= table->ncols) gtk_table_resize (table, table->ncols, table_child->right_attach); break; - case CHILD_ARG_TOP_ATTACH: - if (GTK_VALUE_UINT (*arg) < table_child->bottom_attach) - table_child->top_attach = GTK_VALUE_UINT (*arg); + case CHILD_ARG_RIGHT_ATTACH: + if (GTK_VALUE_UINT (*arg) > 0) + { + table_child->right_attach = GTK_VALUE_UINT (*arg); + if (table_child->right_attach <= table_child->left_attach) + table_child->left_attach = table_child->right_attach - 1; + if (table_child->right_attach >= table->ncols) + gtk_table_resize (table, table->ncols, table_child->right_attach); + } break; - case CHILD_ARG_BOTTOM_ATTACH: - if (GTK_VALUE_UINT (*arg) > table_child->top_attach) - table_child->bottom_attach = GTK_VALUE_UINT (*arg); + case CHILD_ARG_TOP_ATTACH: + table_child->top_attach = GTK_VALUE_UINT (*arg); + if (table_child->bottom_attach <= table_child->top_attach) + table_child->bottom_attach = table_child->top_attach + 1; if (table_child->bottom_attach >= table->nrows) gtk_table_resize (table, table_child->bottom_attach, table->ncols); break; + case CHILD_ARG_BOTTOM_ATTACH: + if (GTK_VALUE_UINT (*arg) > 0) + { + table_child->bottom_attach = GTK_VALUE_UINT (*arg); + if (table_child->bottom_attach <= table_child->top_attach) + table_child->top_attach = table_child->bottom_attach - 1; + if (table_child->bottom_attach >= table->nrows) + gtk_table_resize (table, table_child->bottom_attach, table->ncols); + } + break; case CHILD_ARG_X_OPTIONS: table_child->xexpand = (GTK_VALUE_FLAGS (*arg) & GTK_EXPAND) != 0; table_child->xshrink = (GTK_VALUE_FLAGS (*arg) & GTK_SHRINK) != 0; -- 2.30.2